package com.mgetool.ui.util;

import org.eclipse.swt.graphics.Point;

/**
 * 浮点类型的坐标点类
 * @author wangbin
 *
 */
public class PointF {

	public float x;
	public float y;
	
	public PointF(){
		
	}
	
	public PointF(float x, float y){
		this.x = x;
		this.y = y;
	}
	
	public PointF(int x, int y){
		this.x = x;
		this.y = y;
	}

	public PointF(Point point){
		if(point != null){
			this.x = point.x;
			this.y = point.y;
		}
	}
	
	public boolean equals(float x, float y) {
		// TODO Auto-generated method stub
		return this.x == x && this.y == y;
	}
	
	public boolean equals(PointF pointF) {
		// TODO Auto-generated method stub
		return x == pointF.x && y == pointF.y;
	}
	
	public void offset(float x, float y){
		this.x += x;
		this.y += y;
	}
	
}
